package com.cqq.auth.dao.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.cqq.auth.dao.RoleDao;
import com.cqq.auth.dao.domain.Role;
import com.cqq.auth.dao.mapper.RoleMapper;
import com.cqq.common.core.base.BaseDao;
import com.cqq.common.core.base.BaseQuery;

/**
 * <h3>角色Dao接口实现类</h3>
 * 
 * @author xijq
 * @version 1.0.0
 * 
 */
@Repository("roleDao")
public class RoleDaoImpl extends BaseDao implements RoleDao {
	
	@Autowired
	private RoleMapper roleMapper;

	
	public void add(Role obj) {
		roleMapper.add(obj);
	}

	
	public Integer delete(Serializable id) {
		return roleMapper.delete(id);
	}

	
	public Integer update(Role obj) {
		return roleMapper.update(obj);
	}

	
	public Role queryById(Serializable id) {
		return roleMapper.queryById(id);
	}

	
	public List<Role> queryAll() {
		return roleMapper.queryAll();
	}

	
	public List<Role> queryPage(BaseQuery query) {
		return roleMapper.queryPage(query);
	}

	
	public Integer queryCount(BaseQuery query) {
		return roleMapper.queryCount(query);
	}

	
	public List<Role> queryByUserId(Integer id, String[] systemCode) {
		return roleMapper.queryByUserId(id, systemCode);
	}

	
	public List<Role> queryByUsername(String username, String[] systemCode) {
		return roleMapper.queryByUsername(username, systemCode);
	}

	
	public Role queryByCode(String code, String[] systemCode) {
		return roleMapper.queryByCode(code, systemCode);
	}

	
	public Role queryByName(String name, String[] systemCode) {
		return roleMapper.queryByName(name, systemCode);
	}

	
	public List<Role> queryAllBySystem(String[] systemCode) {
		return roleMapper.queryAllBySystem(systemCode);
	}

	
	public Integer updatePermIds(Integer id, Integer[] permIds) {
		return roleMapper.updatePermIds(id, permIds);
	}

	
	public List<Role> queryByUserGroupId(Integer userGroupId,
			String[] systemCode) {
		// TODO Auto-generated method stub
		return roleMapper.queryByUserGroupId(userGroupId, systemCode);
	}

}
